const mongoose = require('mongoose')
const schema = new mongoose.Schema({
  username: { type: String },
  tel: { type: Number },
  password: {
    type: String,
    set(val) {
      return require('bcrypt').hashSync(val, 12)
    }
  },
  avatar: {
    type: String,
    default: 'http://www.howzhi.com/assets/img/default/avatar.png?7.5.15.6'
  },
  sign: { type: String, default: '您还未设置签名哦 ' },
  name: { type: String },
  sex: { type: Number },
  idNumber: { type: String },
  city: { type: Array },
  company: { type: String },
  job: { type: String },
  rank: { type: String },
  home: { type: String },
  weibo: { type: String },
  weixin: { type: String },
  qq: { type: String },
  weiboChecked: { type: Boolean },
  weixinChecked: { type: Boolean },
  qqChecked: { type: Boolean }
})

module.exports = mongoose.model('User', schema)
